home *** CD-ROM | disk | FTP | other *** search
/ SPACE 1 / SPACE - Library 1 - Volume 1.iso / utilitys / 93 / ppaccell / pcpaccel.doc (.txt) < prev    next >
Encoding:
ST Writer Document  |  1987-10-12  |  5.4 KB  |  99 lines

  1. Do Run Run STWRITER.PRG
  2. Accellerating Xmodem Page @
  3. ACCELLERATING XMODEM TRANSFERS USING TIMED DELAYS
  4.      by Thomas Zerucha / 24075 Lee Baker / Southfield, MI 48075
  5. The problem:
  6.      Telenet will not send a packet unless one of two things occurs:
  7.      1. 128 characters fill a complete packet
  8.      2. A programmable timeout occurs, normally 1/10th of a second
  9.         (this is set as 1/20th of a second multiplied by parameter
  10.           4, as in @SET 4:2<cr> is .1 sec, 4:3 is .15, 4:4 is .2 etc.).
  11.      When transmitting Xmodem packets, the data will collect at your
  12.      end until 128 characters have been sent, and then be sent over the
  13.      network, and be sent (starting from the first character) out at the
  14.      far end.  Note that the first character goes out at the far end
  15.      AFTER the 128th character is sent (and usually later, since Telenet
  16.      is not instantaneous).  This 128 character delay is over 1 sec at
  17.      1200 baud, and 4-1/4 seconds at 300 baud.
  18.      Fortunately, there is a way to speed things up a little by taking
  19.      advantage of the second transmit condition.
  20.      WARNING: this method increases the number of packets sent.  Under
  21.      non-flat-rate conditions you are more likely to exceed your kilo-
  22.      packet limit and that may prove costly.  This is intended for
  23.      normal (evening and weekend) PC Pursuit hours.
  24. A Partial Solution:
  25.      What would happen if we added a .1 second delay in the middle of
  26.      the block?  The packet would be sent half sooner.  So if we can
  27.      set up delays so that data would always be at the far end, and
  28.      the first packet would be sent as soon as possible, we would speed
  29.      up Xmodem transferrs quite a bit.  We have to be careful about
  30.      packing, as the following diagram shows:
  31.      Transmitter:
  32.      TTTTTTTTTTTT---TTTTTTTTTTTT---.................*TTTTTTT->
  33.      Receiver:
  34.                RRRRRRRRRRRR---RRRRRRRRRRRR*---
  35.      * ack     '---' timeout delay
  36.      Note that there is a delay in the receiver, not good if we want
  37.      peak performance.  The best way to fix this is to use shrinking
  38.      packets, the last packet being between 1 and 2 times the delay
  39.      time in length, i.e. a number of characters that would take
  40.      between .1 and .2 seconds to send, and then lengthening each
  41.      packet until the full XModem packet length is contained.  This
  42.      impacts the number of characters in the first packet - in the
  43.      last packet, it can be 4-7 characters and qualify.  But 4+8+...
  44.      adds to either 112 or 144.  Making the first packet too short
  45.      wouldn't speed things up as much as making everything perfect.
  46.      so we have to add characters to each packet:
  47.           112 =  28  24  20  16  12   8   4
  48.           +3 on each
  49.           133 =  31  27  23  19  15  11   7
  50.      note that they still decrease by exactly 4.  If checksum is used
  51.      and 132 characters (which don't add exactly), any subpacket or group
  52.      of successive subpackets can be shortened by one, i.e for 130 chars
  53.           130 =  30  26  22  19  15  11   7
  54.      This will cause the following:
  55.      TTTTTTTTTTTT---ttttttttt---TTTTTT---ttt---........*
  56.                RRRRRRRRRRRRrrrrrrrrrRRRRRRrrr*---
  57.      Values which work for 1200 Baud (the above is for 300) are
  58.           133 = 52 39 27 15
  59.      This works because each group fits within it's previous subpacket.
  60.      Whatever delays inherent in the network will remain, however, there
  61.      will be a savings of .63 sec/Xmodem block @ 1200 Baud, and 2.2 sec
  62.      at 300 Baud.  This will not apply if Telenet is constantly changing
  63.      it's load, but this is rare in the off hours.  Graphically:
  64.      TTTTTTTTTTTT---ttttttttt---TTTTTT---ttt---........*
  65.                  ppp        pppppp   p
  66.                  RRRRRRRRRRRR...rrrrrrrrrRRRRRRrrr*---
  67.      p is the time it takes Telenet to send a packet
  68.      But with a constant delay using accelleration:
  69.      TTTTTTTTTTTT---ttttttttt---TTTTTT---ttt---.............*
  70.                  ppp        ppp      ppp   ppp         ppp
  71.                  RRRRRRRRRRRRrrrrrrrrrRRRRRRrrr*---
  72.      The normal way:
  73.      TTTTTTTTTTTTtttttttttTTTTTTttt---....................................*
  74.                          ppp ppp                      ppp
  75.                          RRRRRRRRRRRRrrrrrrrrrRRRRRRrrr*---
  76. Notes:
  77.      This technique is effective at accelerating any subpacket that can
  78.      be broken so that the largest packet is less than 128 characters
  79.      (minus .1 sec worth of characters - 116 for 1200 baud, or 124 for
  80.      300 baud).  So this will not help Ymodem (1k) packets, but will help
  81.      256 byte packets.  Also remember to add characters up to the maximum
  82.      length of .2 seconds, with many splits this can be significant.
  83.      (3 chars/block at 300 baud, 11 c/blk at 1200).  At 1200 Baud:
  84.           133 = 52 39 27 15     <= optimal
  85.                  5  5  5 -15
  86.           133 = 57 44 32
  87.      Note that both of these hold the property we are looking for, but
  88.      the first is 5 characters (.4 sec) longer for the first packet.
  89.      If the first number would be greater than 128, then the method
  90.      would not help significantly (since the delay would be 0 for the
  91.      129th character, but .1 sec otherwise).
  92.      If we try to divide finer, we end up with packets smaller than the
  93.      delay, or bigger than the previous packet + delay:
  94.           133 = 48 36 24 12 13
  95.                  1  1  1  1 -4
  96.           133 = 49 37 25 13  9
  97.                  3  2  2  2 -9
  98.           133 = 52 39 27 15     <= optimal
  99.